package com.iptv.grape.event.imp;

import com.google.gson.Gson;
import com.iptv.grape.BaseActivity;
import com.iptv.grape.bu.GrapeContext;
import com.iptv.grape.domain.Bookmark;
import com.iptv.grape.event.JSRequest;
import com.iptv.grape.event.proc.IWebViewMessageProc;
import com.iptv.grape.video.XMediaPlayer;

public class DelResourcesInBookmark implements IWebViewMessageProc {
    private Bookmark bookmark;
    @Override
    public void init(JSRequest jsRequest) {
        bookmark = new Gson().fromJson(jsRequest.getJson(), Bookmark.class);
    }

    @Override
    public String procMessage(BaseActivity baseActivity, XMediaPlayer mediaPlayer) {
        GrapeContext.curGrapeContext().getBookmarkList().del(bookmark);
        return "";
    }
}
